let up = document.querySelector(".triangle-up");
let right = document.querySelector(".triangle-right");
let flag = true;
let deg = 0;
let interval = setInterval(() => {
  if (flag) {
    deg += 180;
    up.style.transform = `rotate(${deg}deg)`;
  } else {
    right.style.transform = `rotate(${deg}deg)`;
  }
  flag = !flag;
}, 500);
